import {NgModule} from '@angular/core';
import {RouterModule, Routes} from '@angular/router';
import {DashboardComponent} from "./dashboard/dashboard.component";
import {HeroesComponent} from "./heros/heroes.component";
import {HeroDetailComponent} from "./detail/hero-detail.component";

const routes: Routes = [
    {
        path     : 'heroes',
        component: HeroesComponent
    },
    {
        path     : 'dashboard',
        component: DashboardComponent
    },
    {
        path     : 'detail/:id',
        component: HeroDetailComponent
    },
    {
        path      : '',
        redirectTo: '/dashboard',
        pathMatch : 'full'
    },
];

@NgModule({
    imports: [RouterModule.forRoot(routes)],
    exports: [RouterModule]
})
export class AppRoutingModule {

}
